<template>
  <div class="page demo-table-page">
    <zk-table :columns="columns" :service="service" />
  </div>
</template>
<script>
  import ZkTable from '@/components/zk-table'

  export default {
    components: { ZkTable },
    data() {
      return {
        columns: [
          { key: 'id', label: '编号' },
          { key: 'name', label: '名称' },
        ],
        data: [],
        service: {
          getList({ currentPage = 0, pageSize }) {
            console.log('currentPage', currentPage)
            return currentPage === 1 ? {
              currentPage,
              total: 12,
              list: [
                { id: 3, name: 'name3' },
                { id: 5, name: 'name5' },
              ]
            } : {
              currentPage,
              total: 12,
              list: [
                { id: 1, name: 'name1' },
                { id: 2, name: 'name2' },
              ]
            }
          }
        }
      }
    },
  }
</script>
